# find webkit-1.0
# Once done this will define
# webkit_FOUND
# webkit_INCLUDE_DIRS - The webkit-1.0 include directories
# webkit_LIBRARIES    - The libraries needed to use webkit-1.0
# webkit_DEFINITIONS  - Compiler switches required for using webkit-1.0

find_package(PkgConfig)
pkg_check_modules(PC QUIET webkit-1.0)

#message(STATUS "LIBRARIES    : ${PC_LIBRARIES}")
#message(STATUS "LIBRARY DIRS : ${PC_LIBBRARY_DIRS}")
#message(STATUS "LDFLAGS      : ${PC_LDFLAGS}")
#message(STATUS "LDFLAGS OTHER: ${PC_LDFLAGS_OTHERS}")
#message(STATUS "INCLUDE DIRS : ${PC_INCLUDE_DIRS}")
#message(STATUS "CFLAGS       : ${PC_CFLAGS}")
#message(STATUS "CFLAGS OTHER : ${PC_CFLAGS_OTHER}")

set(webkit_DEFINITIONS ${PC_CFLAGS_OTHER})

find_path(webkit_INCLUDE_DIR  webkit/webkit.h
        HINTS ${PC_INCLUDE_DIRS}
	PATH_SUFFIXES webkit-1.0)

find_library(webkit_LIBRARY NAMES webkitgtk-1.0
        HINTS ${PC_LIBRARY_DIRS} )

set(webkit_LIBRARIES ${webkit_LIBRARY} )
set(webkit_INCLUDE_DIRS ${webkit_INCLUDE_DIR} )

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set webkit_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(webkit DEFAULT_MSG
	webkit_LIBRARY webkit_INCLUDE_DIR)

mark_as_advanced(webkit_INCLUDE_DIR webkit_LIBRARY )
